
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <script src="http://www.e23.cn/2015/js/jquery-1.9.1.min.js"></script>
    <script src="dropzone.js"></script>
    <link rel="stylesheet" href="dropzone.css">
</head>
<body>
<div id="dropz" class="dropzone" ></div>
<script>
Dropzone.autoDiscover = false;

$("#dropz").dropzone({
    url: "upload.php",//上传文件的地址，
    method:"post",  //也可用put
    // paramName:"Filedata", //默认为file
    maxFiles: 20,//最多上传几个图片
    maxFilesize: 512,//图片的大小，单位是M
    acceptedFiles: ".jpg,.jpeg,.png,.gif",//支持的格式
    addRemoveLinks:true,
    dictRemoveFile : "删除",
    dictCancelUpload: "取消",
    dictDefaultMessage: "<h3>点击上传图片</h3>",
    dictMaxFilesExceeded: "只能上传1个文件",
    init:function(){
        this.on("addedfile", function(file) {
            //上传文件时触发的事件
            document.querySelector('div .dz-default').style.display = 'none';
        });
        this.on("success",function(file,data){
            //上传成功触发的事件
            console.log(data);
        });
        this.on("removedfile", function(file) {

                console.log("File " + file.name + "removed");

        });
    }
});

</script>
</body>
</html>

